<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\AuthController;
use App\Http\Controllers\Api\BasicDataController;
use App\Http\Controllers\Api\GridAreaController;
use App\Http\Controllers\Api\GridAssessController;
use App\Http\Controllers\Api\GridHouseController;
use App\Http\Controllers\Api\GridImgController;
use App\Http\Controllers\Api\GridPriceController;
use App\Http\Controllers\Api\CommonController;
use App\Http\Controllers\Api\ApprovalController;
use App\Http\Controllers\Common\FileController;
use App\Http\Controllers\Admin\PrintController;



    Route::post('/login', [AuthController::class, 'login']);
    Route::post('/logout', [AuthController::class, 'logout']);

    Route::group(['middleware' => ['api.basic']], function () {
        Route::get('/api_info', [AuthController::class, 'apiInfo']);//获取用户信息
        Route::post('/upload', [FileController::class, 'upload']);//公共图片上传
        Route::post('/update_info', [AuthController::class, 'updateInfo']);//更新用户信息
        Route::get('/auth_info', [AuthController::class, 'authInfo']);//获取用户权限

        Route::get('/project_list', [BasicDataController::class, 'projectList']);//获取基础数据-项目
        Route::get('/village_list', [BasicDataController::class, 'villageList']);//获取基础数据-村庄
        Route::get('/street_list', [BasicDataController::class, 'StreetList']);//获取基础数据-街道
        Route::get('/user_role_list', [BasicDataController::class, 'userRoleList']);//获取基础数据-身份
        Route::get('/grid_group_list', [BasicDataController::class, 'gridGroupList']);//获取基础数据-网格组
        Route::get('/banner_list', [BasicDataController::class, 'bannerList']);//获取基础数据-banner
        Route::get('/grid_list', [BasicDataController::class, 'gridList']);//获取基础数据-网格
        Route::get('/grid_num', [BasicDataController::class, 'gridNum']);//获取基础数据-网格数量
        Route::get('/assess_company_list', [BasicDataController::class, 'assessCompanyList']);//获取基础数据-评估机构
        Route::get('/mapping_company_list', [BasicDataController::class, 'mappingCompanyList']);//获取基础数据-测绘机构
        Route::get('/disagree_reason_list', [BasicDataController::class, 'disagreeReasonList']);//获取基础数据-不同意拆迁理由
        Route::get('/house_prove_list', [BasicDataController::class, 'houseProveList']);//获取基础数据-房产证号
        Route::get('/segment_list', [BasicDataController::class, 'segmentList']);//获取基础数据-号段
        Route::get('/build_form_list', [BasicDataController::class, 'buildFormList']);//获取基础数据-建筑形式
        Route::get('/protocol_set_list', [BasicDataController::class, 'protocolSetList']);//获取基础数据-协议配置
        Route::get('/grid_info_list', [BasicDataController::class, 'gridInfoList']);//获取基础数据-根据网格id获取网格、村民、代理人信息
        Route::get('/house_type_list', [BasicDataController::class, 'houseTypeList']);//获取基础数据-获取户型信息
        Route::get('/grid_price', [BasicDataController::class, 'gridPrice']);//获取基础数据-获取统计金额
        Route::get('/grid_price_details', [BasicDataController::class, 'gridPriceDetails']);//获取基础数据-获取统计金额详情
        Route::get('/assess_type', [BasicDataController::class, 'AssessType']);//获取评估项目类型
    });


    Route::group(['middleware' => ['api.login']], function () {

        Route::post('/area/add_opinion', [GridAreaController::class, 'addOpinion']);//入户-录入拆迁意见
        Route::get('/area/opinion_list', [GridAreaController::class, 'opinionList']);//入户-拆迁意见回显
        Route::get('/area/id_card_list', [GridAreaController::class, 'idCardList']);//入户-录入身份证回显
        Route::post('/area/add_id_card', [GridAreaController::class, 'addIdCard']);//入户-录入身份证
        Route::get('/area/area_list', [GridAreaController::class, 'areaList']);//入户-面积确认表回显
        Route::post('/area/add_area', [GridAreaController::class, 'addArea']);//入户-录入面积确认表
        
        Route::post('/assess/add_assess', [GridAssessController::class, 'addAssess']);//评估-录入
        Route::get('/assess/assess_list', [GridAssessController::class, 'assessList']);//评估-回显
       
        Route::post('/house/add_house', [GridHouseController::class, 'addHouse']);//选择户型-录入
        Route::get('/house/house_list', [GridHouseController::class, 'houseList']);//选择户型-回显

        Route::post('/img/add_img', [GridImgController::class, 'addImg']);// 户口/房产证、土地证、其他证明/签约/腾房-录入
        Route::get('/img/img_list', [GridImgController::class, 'imgList']);// 户口/房产证、土地证、其他证明/签约/腾房-回显
        
        Route::post('/price/add_price', [GridPriceController::class, 'addPrice']);// 结算/银行/发放-录入
        Route::get('/price/price_list', [GridPriceController::class, 'priceList']);// 结算/银行/发放-回显

        Route::get('/common/download_pdf', [CommonController::class, 'downloadPdf']);//协议pdf下载
        Route::resource('print', PrintController::class);//打印
       
        Route::get('/approval/approval_list', [ApprovalController::class, 'approvalList']);//审批列表
        Route::post('/approval/add_approval', [ApprovalController::class, 'addApproval']);//审批操作
        Route::get('/approval/approval_details', [ApprovalController::class, 'approvalDetails']);//审批详情
        Route::post('/approval/add_table_approval', [ApprovalController::class, 'addTableApproval']);//拒绝后新增面积表审批
        Route::post('/approval/cancel_approval', [ApprovalController::class, 'cancelApproval']);//领导反悔功能
    });

